<h1>Курсы</h1>

{{#if courses.length}}
{{#each courses}}
<div class="row">
  <div class="col s6 offset-s3">
    <div class="card">
      <div class="card-image">
        <img src="{{img}}" alt="{{title}}">
      </div>
      <div class="card-content">
        <span class="card-title">{{title}}</span>
        <p class="price">{{price}}</p>
      </div>
      <div class="card-action actions">
        <a href="/courses/{{id}}" target="_blank">Открыть курс</a>
        <a href="/courses/{{id}}/edit?allow=true">Редактировать</a>
        <form action="/card/add" method="POST">
          <input type="hidden" name="id" value="{{id}}">
          <button type="submit" class="btn btn-primary">Купить</button>
        </form>
      </div>
    </div>
  </div>
</div>
{{/each}}
{{else}}
<p>Курсов пока нет</p>
{{/if}}